package net.esj.basic.dao.jdbc.jpa.support;

import java.util.HashMap;
/**
 * 忽略key的大小写的Map实现。
 * 否则将ResultSet转换为map后，因为大小写的问题，比较麻烦。
 *
 * @param <K>
 * @param <V>
 */
public class IgnoreCaseMap<K,V> extends HashMap<K,V>{
	public V put(K key, V value) {
		if(key instanceof String){
			String key2 = (String)key;
			key = (K)key2.toLowerCase();
		}
		return super.put(key,value);
	}
	 public V get(Object key){
			if(key instanceof String){
				String key2 = (String)key;
				key = key2.toLowerCase();
			}
			return super.get(key);
	 }
	 public boolean containsKey(Object key){
			if(key instanceof String){
				String key2 = (String)key;
				key = key2.toLowerCase();
			}
			return super.containsKey(key);
	 }
}